<% include header.html %>
<link href="/stylesheets/login.css" rel="stylesheet">

<script type="text/javascript">
  $(document).ready(function(){
    $("#Submit").click(function(){
      var usercode = $("#Username").val();
      var passwd = $("#Password").val();
      var param = {usercode:usercode,password:passwd};
      $.post('/login',param,function(data){
        console.log(data);
        if(data.errors){

          $('#Password').after('<div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert"> &times;  </a> <strong>警告！</strong>'+data.errors+' </div>');
          return;
        }
        else{
          window.location=data.redirect;
        }
      });
    });
  });
</script>

<div class="bs-docs-header" id="content" tabindex="-1">
  <div class="container">
    <h2>登陆从这里开始</h2>
  </div>
</div>
    
<div class = "container">
  <div class="wrapper">
    <form action="" method="post" name="Login_Form" class="form-signin" onsubmit="return false">       
        <h3 class="form-signin-heading">My God! Please Sign In</h3>
        <hr class="colorgraph"><br>
        
        <input type="text" class="form-control" id="Username" placeholder="Username" required="" autofocus="true" />
        <input type="password" class="form-control" id="Password" placeholder="Password" />
        <button class="btn btn-lg btn-primary btn-block"  id="Submit" value="Login">Login</button>
    </form>
  </div>
</div>

<% include footer.html %>